<?php

declare(strict_types=1);

namespace App\Model;

use Hyperf\DbConnection\Model\Model;

class Payment extends Model
{
    protected ?string $table = 'data_payment';

    public static $payMentStatus = [
        1 => '待支付',
        2 => '已支付',
        3 => '已取消',
        4 => '已退款',
    ];
    public static $payType= [
        1 => '微信虚拟支付',
        2 => '微信支付',
    ];

    public static $goodsType= [
        1 => '普通充值',
        2 => '1天会员',
        3 => '3天会员',
        4 => '7天会员',
        5 => '15天会员',
        6 => '月度会员',
        7 => '季度会员',
        8 => '半年会员',
        9 => '年度会员',
        10 => '整剧购买',
    ];

    public function playlet()
    {
        return $this->hasOne(Playlet::class, 'id', 'playlet_id')->withTrashed()->select('id','name');
    }

    public function applet()
    {
        return $this->hasOne(Applet::class, 'id', 'applet_id')->withTrashed()->select('id','name');
    }

    public function spread()
    {
        return $this->hasOne(DataSpread::class, 'id', 'spread_id')->withTrashed()->select('id','name');
    }

    public function recharge_goods()
    {
        return $this->hasOne(RechargeGoods::class, 'id', 'goods_id')->withTrashed()->select('id','name');
    }

}
